<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            text-align: center;
        }
    </style>
</head>
<body>
<div>
    {{info}}

    <h1 v-for="name in arr">{{name}}</h1>
    <table border="1">
        <caption>人物列表</caption>
        <tr>
            <th>名字</th>
            <th>年龄</th>
            <th>性别</th>
        </tr>
        <tr v-for="p in persons">
            <td>{{p.name}}</td>
            <td>{{p.age}}</td>
            <td>{{p.gender}}</td>
        </tr>
    </table>

    <table border="1">
        <caption>商品列表</caption>
        <tr>
            <th>品名</th>
            <th>价格</th>
            <th>库存</th>
        </tr>
        <tr v-for="s in products">
            <td>{{s.title}}</td>
            <td>{{s.price}}</td>
            <td>{{s.num}}</td>
        </tr>

    </table>


</div>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    let v= new Vue({
        el:"body>div",
        data:{
            info:"循环遍历",
            arr:["刘备","关羽","张飞"],
            persons:[{name:"刘备",age:30,gender:"男"},
                {name:"孙尚香",age:50,gender:"女"},
                {name:"刘禅",age:40,gender:"男"},],
            products:[{title:"冰红茶",price:3,num:1000},
                {title:"冰绿茶",price:3,num:1200},{title:"脉动",price:5,num:1000},]
        }
    })
</script>

</body>
</html>